package com.common.utils;

import org.apache.commons.lang.StringUtils;


/**
 * <strong>RequestUtils</strong><br>
 * <br> 
 * <strong>Create on : 2012-1-5<br></strong>
 * <p>
 * <strong>Copyright (C) Ecointel Software Co.,Ltd.<br></strong>
 * <p>
 * @author peng.shi peng.shi@ecointel.com.cn<br>
 * @version <strong>Ecointel v1.0.0</strong><br>
 */
public class RequestUtils
{
	
	public static void param2Model(String parameterStr,Object obj){
		String[] tempstr = parameterStr.split("&");
		for (int i = 0; i < tempstr.length; i++) {
			String[] objInfo = tempstr[i].split("=");
			if(objInfo.length>1 && StringUtils.isNotBlank(objInfo[0])&&StringUtils.isNotBlank(objInfo[1])){
				ReflectionUtils.invokeSetterMethod(obj,objInfo[0],objInfo[1]);
			}
		}
	}
	
}
